#include<bits/stdc++.h>
using namespace std;
int n,a[200010],q=-1,num;
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	while(num!=n)
	{
		int q=-1;
		for(int i=1;i<=n;i++)
		{
			if(a[i]==-1)continue;
			if(q!=a[i])
			{
				num++;
				q=a[i];
				a[i]=-1;
				cout<<i<<" ";
			}
		}
		cout<<endl;
	}
	return 0;
}
